package com.motherchild.user.service.impl;


import com.motherchild.user.dto.BabyRecommendationResponse;
import com.motherchild.user.dto.CategoryRecommendation;
import com.motherchild.user.dto.ParentingTip;
import com.motherchild.user.dto.StageTips;
import com.motherchild.user.mapper.RecommendationMapper;
import com.motherchild.user.service.RecommendationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RecommendationServiceImpl implements RecommendationService {

    @Autowired
    private RecommendationMapper recommendationMapper;

    @Override
    public BabyRecommendationResponse getBabyRecommendations(String type, String ageRange) {
        // 获取阶段提示
        StageTips stageTips = recommendationMapper.getStageTips(ageRange);
        
        // 获取分类和产品
        List<CategoryRecommendation> categories = recommendationMapper.getCategoriesWithProducts(ageRange);
        
        // 获取育儿知识
        List<ParentingTip> parentingTips = recommendationMapper.getParentingTips(ageRange);
        
        return new BabyRecommendationResponse(stageTips, categories, parentingTips);
    }
} 